Skip to main content

View Post [edit]

Poster: mrG Date: May 12, 2004 7:40am
Forum: freecache Subject: A simpler method

This will take some coding, but there is a simpler method for sites to serve their large media files via freecache: Offer a Javascript file that will re-write the URLs for certain patterns.

The onionnetworks OpenContent Network does this: You include the link to include the core javascript file, then just insert a line of javascript into your template headers to say "translate all ISO, MPG, MP3 and OGG links" -- on the client browser side, the javascript will scan the document for href's matching the pattern and rewrite them.

This has many advantages:

* apart from the change to the headers, it is completely transparent, which is useful if you have a site like where users contribute some of your media links -- it's hard enough to teach them how to create a hyperlinks, and many sites use HTMLEDIT widgets that would need to be rewritten for selective FreeCache linking.
* It's instantly reverseable if you change your mind and want to serve your OGG files by some other method
* sites using databases to display their links need only change the base template
* freecache can easily upgrade the javascript without having to alert everyone to change their links

Reply [edit]

Poster: mrG Date: Jun 20, 2004 6:12am
Forum: freecache Subject: Re: A simpler method

The exact link for the Javascript and the onload() mod needed to fully enable all large downloads as freecache links can be found at